import request from "@/utils/request.js";

export const addBookDescriptionService = (newBookDescription) => {
  return request.post("/bookdescription/add", newBookDescription);
};

export const updateBookDescriptionService = (updateBookDescription) => {
  return request.put("/bookdescription/update", updateBookDescription);
};
export const deleteBookDescriptionService = (isbn) => {
  return request.delete(`/bookdescription/delete/${isbn}`); //需要使用反引号才能使用嵌入式表达式
};

export const queryBookDescriptionByIsbnService = (isbn) => {
  return request.get("/bookdescription/findbyisbn", { params: { isbn } });
};
export const listBookDescriptionService = (params) => {
  console.log("params:", params);
  return request.get("/bookdescription/page", { params: params });
};
export const queryLikeBookDescriptionByIsbnService = (isbnPartial) => {
  return request.get("/bookdescription/findbyisbnpartial", {
    params: { isbnPartial },
  });
};
